import {
  getFields
} from '@/api/user.js'

const state = {
  type1: 1
}
const mutations = {
  SET_TYPE1: (state, log) => {
    state.type1 = log
  }
}
const actions = {
  getType: ({
    commit
  }, type) => {
    return new Promise(resolve => {
      getFields({
        id: type
      }).then(res => {
        resolve(res)
      }).catch(error => {
        console.log(error)
      })
    })
  },
}
const etters = {

}

export default {
  state,
  mutations,
  actions,
  etters
}